// These are meant to be typed into the REPL. You can also run
// scala -Xnojline < repl-session.scala to run them all at once.
/**
  * 4.2.5 和 Java 数组的互操作
  * Scala 数组是通过 Java 进行实现的， 所以可以进行互相转换操作， 使用
  * scala.collection.convert. AsJavaConverters 或者 AsScalaConverters 进行转换
  */

// 和Java的互操作

import scala.collection.JavaConverters._
import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer

val command = ArrayBuffer("ls", "-al", "/")
// ProessBuilder是java方法
val pb = new ProcessBuilder(command.asJava)
// Scala to Java

val cmd : mutable.Buffer[String] = pb.command().asScala // Java to Scala

cmd == command
